package com.xuxiang.cloud.study.javaagent.demo;

import java.lang.reflect.Method;

public class Main {

    // 执行参数加上 -javaagent:javaagent\target\javaagent-1.0-SNAPSHOT.jar

    public static void main(String [] args) {
        ClassTwo classTwo = new ClassTwo();
        classTwo.println("aaaa");

        try {
            ClassThree classThree = new ClassThree();
            Method method = ClassThree.class.getMethod("println2", String.class);
            method.invoke(classThree, "aaaa");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
